@import '~antd/lib/style/themes/default.less';

@datatable-prefix-cls: antui-datatable;

// DataTable styles
// -----------------------------
.@{datatable-prefix-cls} {
  &.table-row-alternate-color {
    table {
      background: #fff;
      width: 100%;
      tr:nth-child(odd) {
        background: #f6f6f6;
      }
      tr:nth-child(even) {
        background: #fff;
      }
      tr:hover {
        background: rgba(45, 183, 245, 0.2);
      }
    }
  }
  .ant-table-small .ant-table-tbody > tr > td {
    padding: 3px 8px;
    height: 35px;
  }
  .ant-table-small .ant-table-thead > tr > th {
    font-weight: 700;
    color: #666;
    // 表头不换行
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .ant-table-footer {
    padding: 8px;
  }
  .ant-table-tbody > tr.ant-table-row-selected td {
    background: #fffde7;
  }
  .ant-table-tbody > tr {
    &.disabled > td {
      color: rgba(0, 0, 0, 0.25);
      background-color: #f5f5f5;
      cursor: not-allowed;
    }
  }
  .table-row-button {
    button {
      border: none;
      background-color: transparent;
      font-size: 20px;
      height: 20px;
      color: @primary-color;
      padding: 0px 5px !important; // button 为 loading 时 新增
      outline: none;
      vertical-align: middle;
      overflow: hidden;
      > i {
        vertical-align: top;
        margin-left: 0 !important; // button 为 loading 时 新增
        &.anticon-spin + .anticon {
          // button 为 loading 时 新增
          display: none;
        }
      }
      &:hover,
      &:focus {
        background-color: transparent;
        color: tint(@primary-color, 40%);
      }
      &:active,
      &.active {
        background-color: transparent;
      }

      &.disabled,
      &[disabled],
      fieldset[disabled] & {
        &,
        &:hover,
        &:focus,
        &:active,
        &.active {
          background-color: transparent;
          color: #ccc;
        }
      }
    }
  }
}
